<template>
	<view class="content">
		<header>

		</header>
		<section class="card">
			<view class="section1">
				<img class="img1" src="../../static/images/score2.png" alt="" srcset="">
				<view class="box1">
					<view class="txt1">
						供销丰收卡
					</view>
					<view class="txt2">
						cunkou.co
					</view>

				</view>
				<view class="box2">

					默认卡片
				</view>
				<view class="box3">
					<view class="txt1">
						积分
					</view>
					<view class="txt2">
						{{integral}}
					</view>
				</view>
			</view>
			<view class="section2">
				<view class="txt1">
					NO.{{cardNum}}
				</view>
				<view class="img1 op" @click="tixian(integral)">
					积分提现
				</view>
			</view>
		</section>
		<main>
			<view class="mar">
				<view class="pad">
					
						<!-- <img src="../../static/images/score5.png" alt="" srcset=""> -->
						<view class="circle">
							
						</view>
					
					<view class="txt1">
						{{addressList.recycleAddress}}
					</view>
				</view>
				<view class="pad1">
					<view class="flex">
						<view class="img1">
							<img src="../../static/images/score6.png" alt="" srcset="">
						</view>
						<view class="txt1">
							账户状态：
						</view>
					</view>
					
					<view class="txt2" >
						正常
					</view>
				</view>
				<view class="pad1">
					<view class="flex">
						<view class="img1">
							<img src="../../static/images/score7.png" alt="" srcset="">
						</view>
						<view class="txt1">
							姓名：
						</view>
					</view>
					
					<view class="txt2" style="">
						{{addressList.userName}}
					</view>
				</view>
				<view class="pad1">
					<view class="flex">
						<view class="img1">
							<img src="../../static/images/score8.png" alt="" srcset="">
						</view>
						<view class="txt1" style="width: 400rpx;">
							手机号码:
						</view>
					</view>
					
					<view class="txt2" style="">
						{{addressList.userMobile}}
					</view>
				</view>
			</view>
			
		</main>
	</view>
</template>

<script>
	import request from '../../utils/request.js'
	export default {
		data() {
			return {
				integral: '',
				page: 1,
				limit: 5,
				addressList: {},
				cardNum:''
			}
		},

		methods: {
			getRecycleAddressData() {
				let that = this
				request.get('/api/recycle/address/page', {
					page: this.page,
					limit: this.limit
				}).then(res => {
					if (res.code == 0) {
						this.addressList = res.data.list[0]
					}
				})
			},
			tixian(integral){
				uni.navigateTo({
					url: `/pagesA/integral/withdrawal`
				});
				uni.setStorageSync('integral',integral)
			},
			getScoreData() {
				
				let that = this
				request.get('/api/user/detail', {
					
				}).then(res => {
					if (res.code == 0) {
						that.cardNum = res.data.id
						that.integral = res.data.integral
					}
				})
			},
		},
		onLoad() {
			// this.getScoreData()
		},
		onShow() {
			this.getScoreData()
			this.getRecycleAddressData()
			
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		position: relative;
		background: #F1F4F9;
        height: 1624rpx;
		header {
			width: 750rpx;
			height: 160rpx;
			background: var(--global-bg-color);
		}

		.card {
			position: absolute;
			// top: 192rpx;
			top: 32rpx;
			width: 683rpx;
			height: 205rpx;
			background: url('../../static/images/score1.png');
			background-size: 100% 100%;
			margin: 0 12rpx 0 11rpx;
			padding-left: 44rpx;
			padding-top: 54rpx;

			.section1 {
				display: flex;

				.img1 {
					width: 42rpx;
					height: 45rpx;
				}

				.box1 {
					font-family: Source Han Sans SC;
					font-weight: bold;
					color: #FFFFFF;
					margin-left: 12rpx;
					line-height: 23rpx;

					.txt1 {
						font-size: 28rpx;
					}

					.txt2 {
						font-size: 24rpx;
					}

				}

				.box2 {
					margin-left: 12rpx;
					width: 90rpx;
					height: 26rpx;
					background: url('../../static/images/score3.png');
					background-size: 100% 100%;
					font-family: Source Han Sans SC;
					font-weight: 500;
					font-size: 16rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 26rpx;
				}

				.box3 {
					display: flex;
					margin-left: 80rpx;
					text-align: center;

					.txt1 {

						font-family: Source Han Sans SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #FFFFFF;
						line-height: 100rpx;
					}

					.txt2 {

						font-family: Source Han Sans SC;
						font-weight: bold;
						font-size: 56rpx;
						color: #FFFFFF;
					}
				}
			}

			.section2 {
				display: flex;
				justify-content: space-between;

				.txt1 {
					width: 295rpx;
					height: 29rpx;
					font-family: Source Han Sans SC;
					font-weight: bold;
					font-size: 36rpx;
					color: #FFFFFF;

				}

				.img1 {
					width: 140rpx;
					height: 40rpx;
					margin-right: 170rpx;
					background: url('../../static/images/score4.png');
					background-size: 100% 100%;
					font-family: Source Han Sans SC;
					font-weight: 400;
					font-size: 24rpx;
					color: #000000;
					line-height: 40rpx;
					opacity: 0.85;
					text-align: center;
				}
			}
		}

		main {
			margin: 0 24rpx;
			margin-top: 130rpx;
			background-color: #FFFFFF;
			height: 368rpx;
            width: 702rpx;
			.pad {
				width: 100%;
				height: 91rpx;
				display: flex;
				align-items: center;
				border-bottom: 1rpx solid #EBEBEB;

				.img1 {
					img {
						width: 16rpx;
						height: 16rpx;
					}
                    
				}

				.txt1 {
					line-height: 91rpx;
					// margin-left: 31rpx;
					font-family: Source Han Sans SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #000000;
					opacity: 0.85;
				}
			}

			.pad1 {
				// width: 100%;
				height: 91rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				border-bottom: 1rpx solid #EBEBEB;

				.img1 {
					img {
						width: 28rpx;
						height: 32rpx;
					}

				}

				.txt1 {
					margin-left: 19rpx;
					font-family: Source Han Sans SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #000000;
					opacity: 0.45;
				}

				.txt2 {
					// margin-left: 434rpx;

					font-family: Source Han Sans SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #000000;
					opacity: 0.85;
				}
			}
			.flex{
				display: flex;
			}
		}
	}
	.mar{
		padding: 0 24rpx;
		.circle {
			width: 16rpx;
			height: 16rpx;
			background: var(--global-bg-color);
			border-radius: 50%;
			margin-right: 31rpx;
		}
	}
	.op{
		opacity: 0.85;
	}
</style>